// 用户个人收藏
var MyCollection = Vue.component('MyCollection', {
    props: [''],
    data: function () {
        return {
            tableData: [
                {
                    id: 0,
                    type: "公司",
                    img: '../../imgs/icon.png',
                    status: "已读",
                    time: "2018-06-18"
                }, {
                    id: 1,
                    type: "工厂",
                    img: '../../imgs/icon.png',
                    status: "未读",
                    time: "2018-06-18"
                }, {
                    id: 2,
                    type: "人才",
                    img: '../../imgs/icon.png',
                    status: "未读",
                    time: "2018-06-18"
                }, {
                    id: 3,
                    type: "资讯",
                    img: '../../imgs/icon.png',
                    status: "未读",
                    time: "2018-06-18"
                }
            ],
            page: {
                totalPage: 10,
                totalNum: 1,
                pageNum: 10
            }
        }
    },
    created() {
        console.log("请求数据")
    },
    methods: {
        onResume: function () {
            console.log("预览简历")
        },
        onView: function (_id) {
            console.log("查看：", this.tableData[_id])
        },
        givePageFun: function () {
            console.log("切换页数")
        }
    },
    template: `<div class="my-collection">
            <div class="collection-header">
                <div class="collection-header-name">收藏列表</div>
            </div>
            <div class="collection-table collection-table-header">
                <table>
                    <tr>
                        <th>类型</th>
                        <th>图片</th>
                        <th>状态</th>
                        <th>发布时间</th>
                        <th>操作</th>
                    </tr>
                    <tr v-for="value in tableData" v-key="value.id">
                        <td>{{value.type}}</td>
                        <td><img :src='value.img' /></td>
                        <td>{{value.status}}</td>
                        <td>{{value.time}}</td>
                        <td><a herf="#" @click="onView(value.id)">查看</a></td>
                    </tr>
                </table>
            </div>
            <div class="collection-table collection-table-footer">
                <common-page :getPage="page" @givePageFun="givePageFun"></common-page>
            </div>
        </div>`
})